package cn.mes.module.mes.dal.mysql.basemachineinfo;

import cn.mes.framework.common.pojo.PageResult;
import cn.mes.framework.common.pojo.PageParam;
import cn.mes.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.mes.framework.mybatis.core.mapper.BaseMapperX;
import cn.mes.module.mes.dal.dataobject.basemachineinfo.BaseMachinePeopleInfoDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 机台负责人员信息 Mapper
 *
 * @author 游创
 */
@Mapper
public interface BaseMachinePeopleInfoMapper extends BaseMapperX<BaseMachinePeopleInfoDO> {

    default PageResult<BaseMachinePeopleInfoDO> selectPage(PageParam reqVO, String machineId) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BaseMachinePeopleInfoDO>()
            .eq(BaseMachinePeopleInfoDO::getMachineId, machineId)
            .orderByDesc(BaseMachinePeopleInfoDO::getId));
    }

    default int deleteByMachineId(String machineId) {
        return delete(BaseMachinePeopleInfoDO::getMachineId, machineId);
    }

}
